package com.beta.em.pay;

import org.apache.commons.lang3.StringUtils;

/**
 * 支付产品类型为ONEKEY、DIRECT时方有效
 * Created by vector on 2016/12/6.
 */
public enum YeepayCardType {

    DEBIT("DEBIT", "储蓄卡"),
    CREDIT("CREDIT", "信用卡");

    public final String value;
    public final String desc;

    YeepayCardType(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static YeepayCardType getCardType(String value) {
        for (YeepayCardType cardType: values()) {
            if (StringUtils.equals(cardType.value, value)) {
                return cardType;
            }
        }
        return null;
    }

}
